/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Logica;

import java.util.ArrayList;

/**
 *
 * @author Cami
 */
public class Barco extends Elemento{
    
    ArrayList <Canon> canones;
    int velocidadBarco;
    //int distDisparoBarco;
    //int rangoVisionBarco;
  

    //
    public Barco(int largo, int ancho, Coordenadas coord, int vel) {
       super (largo,ancho,coord);
       this.canones=new ArrayList <Canon> ();
       this.velocidadBarco=vel;
       //this.distDisparoBarco=dist;
       //this.rangoVisionBarco=rango;
    }
     
    public int getVelocidadBarco(){
        return velocidadBarco;
    }
    
    public void setVelocidadBarco(int velBarco){
        this.velocidadBarco=velBarco;
    }
    
    public boolean esVacioCanones() {
	return canones.size() == 0;
    }
    public boolean insFrontCanones(Canon c){
        return canones.add(c);
    }
    public Canon primerCanon() {
	return canones.get(0);
    }
    public ArrayList<Canon> getCanones() {
	return this.canones;
    }
    public Canon nesimoCanon(int pos) {
	return canones.get(pos-1);
	}
    
    public void destruirCanonBarco (Barco corsario, int nroCanon){
        corsario.nesimoCanon(nroCanon).setActivo(false);
    }
    
  
    



}
